From: Georges Basile Stavracas Neto Date: Fri, 3 Apr 2020 18:28:57 +0000 (-0300) Subject: iconGrid: Downscale icon size when comparing to defaults X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~684^2^2~543 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=402fd8ec292ee29dead3190ceef9786aa9fecae9;p=gnome-shell.git iconGrid: Downscale icon size when comparing to defaults The return value of st_theme_node_lookup_length() is scaled according to the scale factor. IconGrid.ICON_SIZE is not. However, when BaseIcon tries to fetch the CSS value for "icon-size" (which returns a scaled value), it uses it as-is, mixing the two coordinate systems. Use a single coordinate system (unscaled sizes) in IconGrid.BaseIcon. https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1175 --- diff --git a/js/ui/iconGrid.js b/js/ui/iconGrid.js index 25cd14099..69c3fa52d 100644 --- a/js/ui/iconGrid.js +++ b/js/ui/iconGrid.js @@ -114,8 +114,11 @@ class BaseIcon extends St.Bin { if (this._setSizeManually) { size = this.iconSize; } else { + const { scaleFactor } = + St.ThemeContext.get_for_stage(global.stage); + let [found, len] = node.lookup_length('icon-size', false); - size = found ? len : ICON_SIZE; + size = found ? len / scaleFactor : ICON_SIZE; } if (this.iconSize == size && this._iconBin.child)